# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import codecs
import json

class MyfirstPipeline(object):
    def __init__(self):
        self.file = codecs.open('C:\Python34\mywed\myfirst\myfirst\q.txt','a+')

    def process_item(self, item, spider):
        print(item)
        content = str(item)+'\n'
        #print(x)
        self.file.write(content)
        return item
    def close_spider(self,spider):
        self.file.close()

